#!user/bin/env python3
# -- coding: utf-8 --
from selenium.webdriver.edge.service import Service
from selenium.webdriver.common.by import By
from selenium import webdriver


class Driver:
    drive = webdriver.Edge(service=Service(r'C:\Users\Administrator\PycharmProjects\web_crawler\MicrosoftWebDriver.exe'))
    drive.maximize_window()
    # drive.get('')


class BaseDriver(Driver):

    # def __init__(self, url):
    #     """
    #     :param url:
    #     """
    #     self.url = url
    #
    def __init__(self,url):
        self.url = url

    def get_url(self):
        self.drive.get(self.url)

    def css_select(self, locator):
        """

        :param locator: 
        :param cs_select:
        :return:
        """
        return self.drive.find_element(By.CSS_SELECTOR, locator)

    def css_selects(self, locator):
        """

        :param locator: 
        :param cs_select:
        :return:
        """
        return self.drive.find_elements(By.CSS_SELECTOR, locator)

    def xpath(self, locator):
        """

        :param locator: 
        :param cs_select:
        :return:
        """
        return self.drive.find_element(By.XPATH, locator)

    def xpaths(self, locator):
        """

        :param locator: 
        :param cs_select:
        :return:
        """
        return self.drive.find_elements(By.XPATH, locator)



